import {defineStore} from 'pinia';
export const useCounterStore = defineStore('counter',()=> {
    // ref变量 - state 属性
    const count = ref(0);
    // computed 计算数学-> getters
    // const doubleCount = computed(()=> count.value * 2);
    const double = computed(()=> {return count.value * 2});
    // function 函数 -> actions
    function increment() {
        count.value++;
    }
    return {
        count,
        double,
        increment}
    
})